Hi,guys May be, there is someone can give me a hand. I use the cmd.exe to run a dxl file ,command as follow: doors.exe -cli " string otherAttributes=\"Prefix1#%设计#%Created On\"; print convertToCodepage(currentANSIcodepage(),otherAttributes)" -batch "c:\test" -user aa -password 123456 -d 36677@192.168.0.1 c:\test is a dxl file。 There are some Chinese in the string. Result of print is messy code. Thank you in advance! Alice P6FR_sun_ran - Tue Dec 02 01:51:42 EST 2014 |
Re: Chinese Attribute name lead to coding error Dealing with encoding problems can be cumbersome. I am assuming, that your shell has UTF-8 encoding - but the DXL you are sending to DOORS will be parsed in the native codepage of your machine which might be different. So you need pragma encoding, "UTF-8" inside the code, but I would not bother to try to pass it over the commandline. Write the DXL code to a file and make sure that you save the file in utf-8 encoding and also have the pragma at the top of the file. Then over the commandline call:
doors.exe -cli "#include ^<c:/path/to/file.dxl^>" or something like that to avoid the need for dealing with shell encoding issues ... Of course only put ascii characters in the filename ;-) Regards, Mathias |
Re: Chinese Attribute name lead to coding error Mathias Mamsch - Tue Dec 02 05:48:44 EST 2014 Dealing with encoding problems can be cumbersome. I am assuming, that your shell has UTF-8 encoding - but the DXL you are sending to DOORS will be parsed in the native codepage of your machine which might be different. So you need pragma encoding, "UTF-8" inside the code, but I would not bother to try to pass it over the commandline. Write the DXL code to a file and make sure that you save the file in utf-8 encoding and also have the pragma at the top of the file. Then over the commandline call:
doors.exe -cli "#include ^<c:/path/to/file.dxl^>" or something like that to avoid the need for dealing with shell encoding issues ... Of course only put ascii characters in the filename ;-) Regards, Mathias Yes! write the DXL code to a file is one way to solve this problem. Whether -cli or -dxl will lead to messy code. I privide another way: I encoding the parameters in a java program and then decoding them in DXL script . Thank you very much , Mathias! |
Re: Chinese Attribute name lead to coding error P6FR_sun_ran - Tue Dec 02 21:50:01 EST 2014 Yes! write the DXL code to a file is one way to solve this problem. Whether -cli or -dxl will lead to messy code. I privide another way: I encoding the parameters in a java program and then decoding them in DXL script . Thank you very much , Mathias! Hello You should be aware that doors does support utf-8 but does not support utf-16 and utf-32 and therefore it does not support a real unicode support. If the utf-8-technique fails you can only use the standard code pages, which are supported by doors. You can find them using: int iCp; int iCnt = 0; for iCp in supportedCodepages do { print ++iCnt "\t" codepageName(iCp) "\n"; } Best regards Wolfgang
|